<?php

declare(strict_types=1);

use think\facade\Route;

/*文件上传*/
Route::any('upload','/Upload/upload');

Route::any('redis','/Upload/redis');
/**
 * 首页接口路由组
 */
Route::group('/index',function(){

    /*首页*/
    Route::any('','/index/index')/*->middleware(\app\api\middleware\CheckAdmin::class)*/;

    /*启动页*/
    Route::any('start','/index/start');

    /*随机课程*/
    Route::any('rand_account','/index/rand_account');

    /*机构列表*/
    Route::any('store','/index/store');

    /*机构详情*/
    Route::any('store_detail','/index/store_detail')->middleware(\app\api\middleware\CheckAdmin::class);

    /*教师列表*/
    Route::any('teacher','/index/teacher');

    /*课程列表*/
    Route::any('account','/index/account')->middleware(\app\api\middleware\CheckAdmin::class);

    /*课程详情*/
    Route::any('account_detail','/index/account_detail')->middleware(\app\api\middleware\CheckAdmin::class);

    /*网上课程列表*/
    Route::any('net_list','/index/net_list')->middleware(\app\api\middleware\CheckAdmin::class);

    /*网上课程详情*/
    Route::any('net_detail','/index/net_detail')->middleware(\app\api\middleware\CheckAdmin::class);

    /*搜索查询课程*/
    Route::any('search_item','/index/search_item');

    /*已购网上课程*/
    Route::any('my_net','/index/my_net')->middleware(\app\api\middleware\CheckAdmin::class);

    /*网上课程观看记录*/
    Route::any('see_history','/index/see_history')->middleware(\app\api\middleware\CheckAdmin::class);

    /*收藏*/
    Route::any('collect','/index/collect')->middleware(\app\api\middleware\CheckAdmin::class);

    /*我的收藏*/
    Route::any('my_collect','/index/my_collect')->middleware(\app\api\middleware\CheckAdmin::class);

});

/*文章-新闻-资讯路由组*/
Route::group('/article',function(){

    /*新闻动态 || 校园风采列表*/
    Route::any('','article/index');

    //资讯详情
    Route::any('article_detail','article/article_detail');

    /*用户动态*/
    Route::any('topic','article/topic');

    /*发布帖子*/
    Route::any('create_topic','article/create_topic')->middleware(\app\api\middleware\CheckAdmin::class);

    /*帖子详情*/
    Route::any('topic_detail','article/topic_detail');

    /*帖子评论*/
    Route::any('push_comment','article/push_comment')->middleware(\app\api\middleware\CheckAdmin::class);

    /*回复评论*/
    Route::any('answer_comment','article/answer_comment')->middleware(\app\api\middleware\CheckAdmin::class);

    /*我的帖子*/
    Route::any('my_topic','article/my_topic')->middleware(\app\api\middleware\CheckAdmin::class);

    /*帖子点赞*/
    Route::any('topic_collect','article/topic_collect')->middleware(\app\api\middleware\CheckAdmin::class);

    /*帖子增加转发数*/
    Route::any('topic_trans','article/topic_trans')->middleware(\app\api\middleware\CheckAdmin::class);
});
/*积分商城路由组*/
Route::group('/integral',function(){

    /*积分商城商品列表 */
    Route::any('','integral/index')->middleware(\app\api\middleware\CheckAdmin::class);

    /*用户订单*/
    Route::any('order','integral/order')->middleware(\app\api\middleware\CheckAdmin::class);

    /*提交订单*/
    Route::any('create_order','integral/create_order')->middleware(\app\api\middleware\CheckAdmin::class);

    /*商品详情*/
    Route::any('item_detail','integral/item_detail');

});

/*课程订单路由组*/
Route::group('/order',function(){

    /*订单列表*/
    Route::any('order','order/order')->middleware(\app\api\middleware\CheckAdmin::class);

    /*评价订单*/
    Route::any('push_comment','order/push_comment')->middleware(\app\api\middleware\CheckAdmin::class);

    /*提交线下课程订单*/
    Route::any('create_order','order/create_order')->middleware(\app\api\middleware\CheckAdmin::class);

    /*提交网上课程订单*/
    Route::any('buy_net','order/buy_net')->middleware(\app\api\middleware\CheckAdmin::class);

    /*支付宝回调*/
    Route::any('alipay_notify','order/notify');

    /*建行支付回调*/
    Route::any('notify','order/test_notify');

    /*对账单*/
    Route::any('record','order/record');

    /*建行退款*/
    Route::any('test_refund','order/test_refund');

    /*支付宝退款*/
    Route::any('refund','order/refund');

    /*申请退款*/
    Route::any('up_refund','order/up_refund');

    Route::any('pay_order','order/pay_order')->middleware(\app\api\middleware\CheckAdmin::class);

    /*订单详情*/
    Route::any('order_detail','order/order_detail')->middleware(\app\api\middleware\CheckAdmin::class);

    /*我的评价*/
    Route::any('my_comment','order/my_comment')->middleware(\app\api\middleware\CheckAdmin::class);

    /*删除评价*/
    Route::any('del_comment','order/del_comment')->middleware(\app\api\middleware\CheckAdmin::class);

    /*订单填写信息*/
    Route::any('write_info','order/write_info')->middleware(\app\api\middleware\CheckAdmin::class);

});

/*用户路由组*/
Route::group('/user',function(){

    /*用户信息 */
    Route::any('','user/index')->middleware(\app\api\middleware\CheckAdmin::class);

    /*修改用户信息 */
    Route::any('change_user_info','user/change_user_info')->middleware(\app\api\middleware\CheckAdmin::class);

    /*用户登录协议*/
    Route::any('login_text','user/login_text');

    /*发送短信验证码 */
    Route::any('send_code','user/send_code');

    /*注册 */
    Route::any('register','user/register');

    /*登录 */
    Route::any('login','user/login');

    /*问题解答*/
    Route::any('question','user/question');

    /*获取微信分享token*/
    Route::any('token','user/token');
});
/**
 * 聊天室路由
 */
Route::group('/chat',function() {

    /*订单列表*/
    Route::any('order', '/chat/order');

    /*商品列表*/
    Route::any('goods', '/chat/goods');

    /*聊天列表*/
    Route::any('chat_member', '/chat/chat_member');

    /*用户聊天列表*/
    Route::any('user_chat_member', '/chat/user_chat_member')->middleware(\app\api\middleware\CheckAdmin::class);

    /*聊天信息*/
    Route::any('chat_message', '/chat/chat_message');
});
